#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define mp make_pair
const int maxn = 1e5+10;
const int mod = 1e9+7;
const int INF = 0x3f3f3f3f;
int d[4][2]={1,0,0,1,-1,0,0,-1};
int n,m;
bool vis[maxn];
ll val[maxn];
vector<int> V[maxn];
int main() {
    ios::sync_with_stdio(0);
    #ifdef Uncle_drew
    freopen("in.txt","r",stdin);
    freopen("out.txt","w",stdout);
    #else
    #endif
    cin>>n>>m;
    for(int i=1;i<=n;i++)   cin>>val[i];
    for(int i=0,u,v;i<m;i++){
        cin>>u>>v;
        V[u].pb(v);V[v].pb(u);
    }
    int ans=0;
    for(int i=1;i<=n;i++){
        bool mid=1;
        for(int j=0;j<V[i].size();j++){
            if(val[i]<=val[V[i][j]]){
                mid=0;
                break;
            }
        }
        if(mid==1){
            ans++;
            // cout<<i<<endl;
        }
    }
    cout<<ans<<endl;
    return 0;
}